<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css">
    <style>
        .register{
            width: 400px;
            margin: 0 auto;
        }
    </style>

</head>
<body>
<div class="register">
    <form action="post">
        {{ crsf_token }}
        {% for field in form %}
            {% if field.name == 'code' %}
            <div class="form-group">
            <label for="{{ field.id_for_label }}">{{ field.label }}</label>
                <div class="clearfix">
                <div class="col-md-6" style="padding-left: 0"> {{ field }}</div>
                <div class="col-md-6"><input type="submit" class="btn btn-default" value="获取验证码"></div>
            </div>
            </div>
            {% else %}
                <div class="form-group">
                    <label for="{{ field.id_for_label }}">{{ field.label }}</label>
                    {{ field }}
                </div>
            {% endif %}
        {% endfor %}
        <input type="submit" value="提交" class="btn btn-primary">
    </form>
</div>
</body>
</html>